package com.ruoyi.mhrb.cases.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.uuid.Seq;
import com.ruoyi.mhrb.cases.domain.MhrbCaseLists;
import com.ruoyi.mhrb.cases.mapper.MhrbCaseListsMapper;
import com.ruoyi.mhrb.cases.service.IMhrbCaseListsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 案例列表Service业务层处理
 *
 * @author jhrb
 * @date 2024-11-26
 */
@Service
public class MhrbCaseListsServiceImpl implements IMhrbCaseListsService {
    @Autowired
    private MhrbCaseListsMapper mhrbCaseListsMapper;


    /**
     * 查询案例列表
     *
     * @param id 案例列表主键
     * @return 案例列表
     */
    @Override
    public MhrbCaseLists selectMhrbCaseListsById(Long id) {
        return mhrbCaseListsMapper.selectMhrbCaseListsById(id);
    }

    /**
     * 查询案例列表列表
     *
     * @param mhrbCaseLists 案例列表
     * @return 案例列表
     */
    @Override
    public List<MhrbCaseLists> selectMhrbCaseListsList(MhrbCaseLists mhrbCaseLists) {
        return mhrbCaseListsMapper.selectMhrbCaseListsList(mhrbCaseLists);
    }

    /**
     * 新增案例列表
     *
     * @param mhrbCaseLists 案例列表
     * @return 结果
     */
    @Override
    public int insertMhrbCaseLists(MhrbCaseLists mhrbCaseLists) {
        mhrbCaseLists.setTimeDate(new Date());
        Seq seq = new Seq();
        mhrbCaseLists.setNumber(seq.getNum("s"));
        return mhrbCaseListsMapper.insertMhrbCaseLists(mhrbCaseLists);
    }

    /**
     * 修改案例列表
     *
     * @param mhrbCaseLists 案例列表
     * @return 结果
     */
    @Override
    public int updateMhrbCaseLists(MhrbCaseLists mhrbCaseLists) {
        return mhrbCaseListsMapper.updateMhrbCaseLists(mhrbCaseLists);
    }

    /**
     * 批量删除案例列表
     *
     * @param ids 需要删除的案例列表主键
     * @return 结果
     */
    @Override
    public int deleteMhrbCaseListsByIds(Long[] ids) {
        return mhrbCaseListsMapper.deleteMhrbCaseListsByIds(ids);
    }

    /**
     * 删除案例列表信息
     *
     * @param id 案例列表主键
     * @return 结果
     */
    @Override
    public int deleteMhrbCaseListsById(Long id) {
        return mhrbCaseListsMapper.deleteMhrbCaseListsById(id);
    }
}
